const mongoose = require('../conf/db')

const schema = new mongoose.Schema({
  username: {
    type: String,
    required: true
  },
  password: {
    type: String,
    required: true
  },
  phone: {
    type: Number,
    required: true
  },
  address: {
    type: String,
    required: false,
    default: ''
  },
  balance: {
    type: Number,
    required: false,
    default: 0
  },
  coupon: {
    type: String,
    required: false,
    default: ''
  }
})

const model = mongoose.model('user', schema)

module.exports = model
